package com.itheima.mapper;

import com.itheima.pojo.Student;
import com.itheima.pojo.StudentQueryParam;
import org.apache.ibatis.annotations.*;

import java.util.List;
import java.util.Map;

@Mapper
public interface StudentMapper {


     List<Student> selectPage(StudentQueryParam studentQueryParam);

     void deleteByIds(Integer[] ids);

     @Insert( "insert into student(name,no,gender,phone,id_card,is_college,address,degree,graduation_date,clazz_id,create_time,update_time)"
             +"values(#{name},#{no},#{gender},#{phone},#{idCard},#{isCollege},#{address},#{degree},#{graduationDate},#{clazzId},#{createTime},#{updateTime})")
     void add(Student student);
     // 统计班级学生数


     // 统计学员学历
     @MapKey("name")
     List<Map> countByDegree();
     @MapKey("name")
     List<Map> countStudent();
     @Select( "select * from student where id=#{id}")
     Student getInfoById(Integer id);

     void update(Student student);

//     @Delete("delete from student where id=#{id}")
//     void delete(Integer id);
}
